package com.hw.dagl.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.hw.dagl.model.Frm_Code;
import com.hw.dagl.model.Frm_Department;
import com.hw.dagl.service.CodeService;
import com.hw.dagl.service.impl.FrmCodeServiceImpl;
import com.hw.dao.utils.ControllerUtil;

/**
 * 系统字典类型
 */
@Controller
public class CodeController extends BaseController {

    @Autowired
    private CodeService codeServiceImpl;
    
    @RequestMapping(method= RequestMethod.POST)
    public void findHpzl(HttpServletResponse response) {
        List<Frm_Code> list = FrmCodeServiceImpl.hpzlFrmCodes;
        ControllerUtil.renderJson(response, list, "encoding:UTF-8", "no-cache:false");
    }

    /**
     * 根据系统字典类型查询
     * @param request
     * @param response
     * @param dmlb
     */
    @RequestMapping(method= RequestMethod.POST)
    public void findCodeByCodetype(HttpServletRequest request ,HttpServletResponse response,
                                   String dmlb,String xtlb) {
        List<Frm_Code> list = codeServiceImpl.findCodeByCodetype(dmlb,xtlb);
        ControllerUtil.renderJson(response, list, "encoding:UTF-8", "no-cache:false");
    }
    
   
    
}
